# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ipdecap
pkgver=96.45d2a7d
pkgrel=2
groups=('blackarch' 'blackarch-networking')
pkgdesc='Can decapsulate traffic encapsulated within GRE, IPIP, 6in4, ESP (ipsec) protocols, and can also remove IEEE 802.1Q (virtual lan) header.'
arch=('x86_64' 'aarch64')
url='http://www.loicp.eu/ipdecap#dependances'
license=('GPL3')
depends=('openssl' 'libpcap')
makedepends=('git')
source=("git+https://github.com/lpefferkorn/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  chmod +x autogen.sh

  ./autogen.sh

  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" AUTHORS Contributors \
    INSTALL NEWS README TODO ChangeLog
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

